package com.seat.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


// ======== 支持跨域 ========
@Configuration
public class CrossOriginConfig  implements WebMvcConfigurer {
    @Override
    public void addCorsMappings(CorsRegistry registry) {
       registry.addMapping("/**")
               .allowedHeaders("*")
               .allowedMethods("*")
               .maxAge(2000)
               .allowedOrigins("*");
    }
}
